<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Comment</title>
</head>

<body>
	<?php
        //if (isset($_COOKIE["Studial"]))
        //{
			//$nameCookie = $_COOKIE['Studial'];
			
			@ $UserID = $_GET['UserID'];
			@ $TopicID = $_POST['TopicID'];
			@ $Comment = $_POST['Comment'];
			
            $ini_array = parse_ini_file("../config1.ini");
			@ $con = mysql_pconnect($ini_array['dblink'], $ini_array['dbuser'], $ini_array['dbpass']);
				
			if (!$con)
			{
				die('Could not connect: ' . mysql_error());
			}
				
			@ mysql_set_charset('utf8');
			@ mysql_select_db($ini_array['dbname']);
			
			$now = getdate();
			$hour = $now["hours"]; 
			$minute = $now["minutes"];
			$second = $now["seconds"];
			$day = $now["day"];
			$month = $now["mon"];
			$year = $now["year"];
			
			$result = "INSERT INTO `Srudial`.`topic` (`user_id`, `topic_id`, `content`, `datecreated`, `numliked`) VALUES ('".$UserID."', '".$TopicID."', '".$Comment."', '".$now."', 1)";
			
			$query = mysql_query($result) or die('Error, query failed');
        //}
        //else
        //{
            //header('location: ../login/deletecookies.php');
            //exit;
        //}
	?>
</body>
</html>